package sanrenxing.dayEnd.backRepertoryTotal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sanrenxing.dayEnd.backRepertoryTotal.service.TransactionService;
import sanrenxing.dayEnd.backRepertoryTotal.service.WaveService;

import java.util.HashMap;
import java.util.Map;

/**
 * 股票价格波动表
 */

@RestController
@RequestMapping("wave")
public class WaveController {

    @Autowired
    private WaveService waveService;
    //自动装配  业务处理方法 改
    @Autowired
    private TransactionService transactionService;

    @GetMapping("/method")
    public Map<String,Object> selectByPage(int limit, int page){
        Map<String, Object> map = new HashMap<>();
        map.put("msg","");
        map.put("code",0);
        //证券信息 改
        map.put("securi",transactionService.SecuritiesInfomationLXF());
        map.put("count",waveService.count());
        map.put("data",waveService.selectAll(((page-1)*limit)+1,(((page-1)*limit)+limit)+1));
        return map;
    }

}
